package com.flowersinc.shop.model
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	import mx.controls.Image;

	[Event(name="orderPlaced", type="flash.events.Event")]
	[Event(name="itemDeleted", type="flash.events.Event")]
	[Event(name="infoShowed", type="flash.events.Event")]
	
	public class Flower extends EventDispatcher
	{	
		[Bindable]	
		public var name : String;
		
		[Bindable]
		public var price : Number; 
		
		[Bindable]
		public var color : String;
		
		[Bindable]
		public var description : String;
		
		[Bindable]
		public var image: String;
		
		[Bindable]
		public var thumbImage : String;

		[Bindable]
		public var number : Number = 0;
		
		[Bindable]
		public var canOrder : Boolean = true;
		
		[Bindable]
		public var amount : Number;

		[Bindable]
		public var rating : Number = 0;

		public function placeOrder() : void 
		{
			dispatchEvent(new Event("orderPlaced"));
		}
		
		public function deleteItem() : void 
		{
			dispatchEvent(new Event("itemDeleted"));
		}
		
		public function showInfo() : void 
		{
			dispatchEvent(new Event("infoShowed"));
		}
	}
}